package service;

import com.alibaba.fastjson.JSONArray;
import dao.StudentDao;
import dao.StudentDaoImp;
import pojo.Student;

import java.sql.SQLException;

/**
 * 2022.03.17测试完成 由李红玉编写完成
 */
public class StudentService {
    StudentDao studentDao=new StudentDaoImp();

    /**
     * 显示学生表全部数据
     */
    public JSONArray allShow() throws SQLException {
        JSONArray jsonArray=studentDao.allShow();
        return jsonArray;
    }

    /**
     * 新增学生表数据
     */
    public int insert(Student student) throws SQLException {
        return studentDao.insert(student);
    }

    /**
     * 删除学生表数据
     */
    public int del_Update(Student student) throws SQLException {
        return studentDao.del_Update(student);
    }

    /**
     * 修改学生表数据
     */
    public int update(Student student) throws SQLException {
        return studentDao.update(student);
    }

    /**
     * 打卡学生违纪功能
     */
    public int violation(Student student) throws SQLException {
        return studentDao.violation(student);
    }
}
